import {Tabs} from 'antd'
import React, {useState, useEffect} from 'react'
import http from '../../../../utils/http'
import BasicInformation from './basicInformation'
import GoodsDetails from './goodsDetails'
import PriceInventory from './priceInventory'
const {TabPane} = Tabs

// tab标签页
const AddGoodsTab = (props) => {
  const {getDate, isEdit} = props
  // 默认选中的tab
  const [defaultActiveKey, setdefaultActiveKey] = useState('1')
  const callback = (key) => {
    console.log(key)
    setdefaultActiveKey(key)
  }
  return (
    <div className='tabNav'>
      <Tabs className='tab' defaultActiveKey={defaultActiveKey} activeKey={defaultActiveKey} onChange={callback} >
        <TabPane tab={
          <>
            <div className="tabPaneBtn" >1.编辑基本信息</div>
            <span className='rotateBox1'></span>
          </>
        } key="1">

          <BasicInformation setdefaultActiveKey={setdefaultActiveKey} {...props}></BasicInformation>

        </TabPane>
        <TabPane tab={
          <>
            <div className="tabPaneBtn" >2.编辑价格库存</div>
            <span className='rotateBox1'></span>
          </>
        } key="2">

          <PriceInventory setdefaultActiveKey={setdefaultActiveKey} {...props}></PriceInventory>

        </TabPane>
        <TabPane tab={<div className="tabPaneBtn" >3.编辑商品信息</div>} key="3">

          <GoodsDetails setdefaultActiveKey={setdefaultActiveKey} {...props} getDate={getDate}></GoodsDetails>

        </TabPane>

      </Tabs >


    </div>
  )
}

export default AddGoodsTab